home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstdio.arc / SRC.ARC / MSTIM.A < prev    next >
Text File  |  1985-05-17  |  783b  |  44 lines

  1. ;    mstim.a - get system time.
  2. ;    (C) Copyright 1984, 1985 Gregory R. Mansfield - All Rights Reserved.
  3. ;    G. R. Mansfield.  84/07/01.
  4. ;    Ver 1.1-5517.
  5.  
  6.  
  7.     include    "include/msdos.ah"
  8.  
  9.     cseg
  10.     public    mstim_
  11.  
  12.  
  13. ;    int mstim(tm)
  14. ;    struct tm *tm;    /* see <time.h> */
  15.  
  16. mstim_:
  17.     mov    bx,sp        ; pointer to structure
  18.     mov    di,[bx+2]
  19.     mov    ah,FR_GTM    ; get time
  20.     int    I_FCN
  21.     push    dx        ; save hundredths
  22.     mov    al,dh        ; tm_sec - seconds
  23.     cbw
  24.     stosw
  25.     mov    al,cl        ; tm_min - minutes
  26.     stosw
  27.     mov    al,ch        ; tm_hour - hours
  28.     stosw
  29.     mov    ah,FR_GDT    ; get date
  30.     int    I_FCN
  31.     cbw            ; save weekday
  32.     mov    bx,ax
  33.     mov    al,dl        ; tm_mday - day of month
  34.     stosw
  35.     mov    al,dh        ; tm_mon - month
  36.     dec    ax
  37.     stosw
  38.     mov    ax,cx        ; tm_year - year
  39.     stosw
  40.     mov    [di],bx        ; tm_wday - weekday
  41.     pop    ax
  42.     cbw
  43.     ret
  44.